package io.gitee.zhangbinhub.acp.boot.base

import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.oas.models.info.Contact
import io.swagger.v3.oas.models.info.Info

/**
 * @since JDK 17
 */
abstract class BaseApiConfiguration(private val version: String?) {
    protected fun buildApiInfo(
        title: String,
        description: String,
        contactName: String = "",
        contactUrl: String = "",
        contactEmail: String = ""
    ): OpenAPI = OpenAPI().info(
        Info()
            //页面标题
            .title(title)
            //创建人
            .contact(Contact().name(contactName).url(contactUrl).email(contactEmail))
            //版本号
            .version(version)
            //描述
            .description(description)
    )
}
